Filename: SAVEASICO.XLA Type: Microsoft Excel 3.0 (PC Version) Add-In Macro Version: 1.0 By: Frank Reidelberger CIS: 73230,650 Date: October 12, 1991 Purpose: Add Active Excel Document as Icon to Program Manager Group Legal Stuff ----------- SAVASICO.XLA is hereby donated freely to the public domain. It can be copied and used free of charge. Please distribute this documentation file along with the macro so that others can be aware of what they are getting. There are no warrantees whatsoever, either expressed or implied with respect to the operation of this product. If you decide to use it, you do so at your own risk. Since I'm giving it away for free, I really can't provide much in the way of support either. However, if you have a particular question or problem leave me a message and I'll try to help when I can. While I try to check in to the MSEXCEL forum weekly, your chances are probably better with a Compuserve Mail message. Introduction ------------ I have often thought the process of adding an icon to the Program Manager was rather awkward. It should be easier to do this, especially when creating new documents in an application like Excel. This Excel 3.0 addin macro allows users to save the file and automatically add the icon from Excel's own FILE menu. Novice users will find this particularly appealing since it will make it much easier to find their documents. Instructions for Use -------------------- Simply place the extracted SAVASICO.XLA file in the XLSTART subdirectory. The location of this subdirectory will vary by installation, but is usually found one level below the directory where Excel is installed. You should be aware that any Excel file placed in the XLSTART subdirectory will be immediately available to Excel upon startup. There are several VERY useful add-ins and templates which ship with the Excel package. Refer to your Excel manual for details. Logic ----- If the active document has never been saved, a standard FILE.SAVE.AS dialog box is displayed. If it has previously been saved, but has changed since last saved, a standard FILE.SAVE is done. This ensures that an up-to-date version of the file exists on disk before adding the icon to Program Manager. Note that if the user cancels out of the FILE.SAVE.AS dialog box, the macro does not continue. A dialog box is then displayed, prompting the user for an icon and group names. The icon name is set to the filename by default but may be changed by the user. The group name may either be of an existing group or of a new group which will be created automatically. If the user clicks on the 'OK' button without entering both values, an alert message is displayed and the macro ends with no further action. The macro will also end if the user clicks on the CANCEL button. If the dialog box is completed and the OK button is clicked, a DDE conversation is initiated with Program Manager. The specified group is selected (or created if necessary), and the item is added. The properties used for the item are: Description: the icon name entered into the dialog box Command Line: the complete path and filename of the active document Icon: EXCEL.EXE Additional Comments ------------------- Note that the assumption is made that EXCEL.EXE is in the DOS search path. If this is not the case, one of the default Program Manager icons will be used. I am also assuming that Program Manager is being run as your Windows shell as people using other shells will not have much use for this macro. The code is structured, but has only been mildly 'optimized' so that those interested can read it without going batty. Speed of execution is fine on a 386/20, and memory utilization is about 27Kb (per Excel's HELP.ABOUT). This macro has not been tested on any platform other than DOS/Windows. As always, I am interested in constructive comments regarding ways to improve the code. Of particular interest are inputs regarding improvements in the structure, speed of execution, and features. Please leave this feedback in either the MSEXCEL forum, or via Compuserve Mail. Enjoy. :) Frank Reidelberger